package cn.tedu.inner;
/**本类用作内部类入门案例*/
public class TestInner1 {
    public static void main(String[] args) {
        Outer.Inner oi = new Outer().new Inner();
        oi.delete();
        System.out.println(oi.sum);
        new Outer().find();
    }
}
class Outer{
    String name;
    private int age;


    public void find(){
        System.out.println("Outer...find()");
        Inner in1=new Inner();
        in1.delete();
        System.out.println(in1.sum);
    }

    class Inner{//定义内部类
        int sum=100;
        public void delete(){
            System.out.println("Inner...delete()");
            System.out.println(name);
            System.out.println(age);
            //注意:这里只能单向调用,不能来会调用,否则会死循环
            //造成栈溢出异常
//            find();
        }
    }
}